package cn.credit.loan.service.approve;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.credit.loan.dao.approve.ApproveMapper;
import cn.credit.loan.entity.Approve;
@Service
@Transactional
public class ApproveServiceImpl implements ApproveService {
	@Autowired
	public ApproveMapper approveMapper;
	
	/**
	 * 审批信息添加
	 */
	@Override
	public boolean getApproveAdd(Approve approve) throws Exception {
		if(approve!=null)
		{
			int num=approveMapper.getApproveAdd(approve);
			if(num>0)
			{
				return true;
			}
		}
		return false;
	}

	/**
	 * 审批信息更新
	 */
	@Override
	public boolean getApproveUpdate(Approve approve) throws Exception {
		if(approve!=null)
		{
			int num=approveMapper.getApproveUpdate(approve);
			if(num>0)
			{
				return true;
			}
		}
		return false;
	}
	/**
	 * 审批信息删除
	 */
	@Override
	public boolean getApproveDelete(int approveId) throws Exception {
		return approveMapper.getApproveDelete(approveId);
	}
	/**
	 * 审批信息查询
	 */
	@Override
	public List<Approve> getApproveList(Approve approve) throws Exception {
		List<Approve> approvelist=approveMapper.getApproveList(approve);
		if(approvelist!=null)
		{
			return approvelist;
		}
		return null;
	}

}
